import csv
file =csv.reader(open('data_reslut31.csv','r',encoding='utf8'))
file_data = [i for i in file]
file2 = csv.reader(open('result5.7.2.csv', 'r', encoding='utf8'))
file2_data = [j for j in file2]
for i,item in enumerate(file_data):
    if i ==0:
        continue
    Stkcd = item[0]
    year = int(item[1])
    for j,info in enumerate(file2_data):
        if j ==0:
            continue
        Stkcd5 = info[0]
        year5 = int(info[1])
        if Stkcd == Stkcd5 and year5 ==year-1:
            all_data = item+info
        else:
            print(item)
            # with open('data_reslut31_2.csv','a',encoding='utf8',newline='') as f:
            #     writer = csv.writer(f)
            #     writer.writerow(all_data)
            # print(all_data)